import QtQuick 1.1
import com.nokia.meego 1.0

SelectionDialog {
    id: singleSelectionDialog
    titleText: qsTr("Select color")
    selectedIndex: 0

    delegate: Rectangle {
        id: colorDelegate
        width: parent.width
        height: 100
        color: mouseArea.pressed ? "grey" : "white"
        Label {
            id: colorName
            anchors.verticalCenter: parent.verticalCenter
            anchors.left: parent.left
            verticalAlignment: Text.AlignVCenter
            text: model.name
            width: 150
            height: parent.height
            color: mouseArea.pressed ? "white" : "black"
        }
        Rectangle {
            anchors.verticalCenter: parent.verticalCenter
            anchors.left: colorName.right
            anchors.right: parent.right
            height: parent.height
            color: model.name
//            width: parent.width -
        }
        MouseArea {
            id: mouseArea
            anchors.fill: parent
            onClicked: {
                singleSelectionDialog.selectedIndex = index
                singleSelectionDialog.accept()
            }
        }
    }

    model: ListModel {
        ListElement { name: "aliceblue" }
        ListElement { name: "antiquewhite" }
        ListElement { name: "aqua" }
        ListElement { name: "aquamarine" }
        ListElement { name: "azure" }
        ListElement { name: "beige" }
        ListElement { name: "bisque" }
        ListElement { name: "black" }
        ListElement { name: "blanchedalmond" }
        ListElement { name: "blue" }
        ListElement { name: "blueviolet" }
        ListElement { name: "brown" }
        ListElement { name: "burlywood" }
        ListElement { name: "cadetblue" }
        ListElement { name: "chartreuse" }
        ListElement { name: "chocolate" }
        ListElement { name: "coral" }
        ListElement { name: "cornflowerblue" }
        ListElement { name: "cornsilk" }
        ListElement { name: "crimson" }
        ListElement { name: "cyan" }
        ListElement { name: "darkblue" }
        ListElement { name: "darkcyan" }
        ListElement { name: "darkgoldenrod" }
        ListElement { name: "darkgray" }
        ListElement { name: "darkgreen" }
        ListElement { name: "darkgrey" }
        ListElement { name: "darkkhaki" }
        ListElement { name: "darkmagenta" }
        ListElement { name: "darkolivegreen" }
        ListElement { name: "darkorange" }
        ListElement { name: "darkorchid" }
        ListElement { name: "darkred" }
        ListElement { name: "darksalmon" }
        ListElement { name: "darkseagreen" }
        ListElement { name: "darkslateblue" }
        ListElement { name: "darkslategray" }
        ListElement { name: "darkslategrey" }
        ListElement { name: "darkturquoise" }
        ListElement { name: "darkviolet" }
        ListElement { name: "deeppink" }
        ListElement { name: "deepskyblue" }
        ListElement { name: "dimgray" }
        ListElement { name: "dimgrey" }
        ListElement { name: "dodgerblue" }
        ListElement { name: "firebrick" }
        ListElement { name: "floralwhite" }
        ListElement { name: "forestgreen" }
        ListElement { name: "fuchsia" }
        ListElement { name: "gainsboro" }
        ListElement { name: "ghostwhite" }
        ListElement { name: "gold" }
        ListElement { name: "goldenrod" }
        ListElement { name: "gray" }
        ListElement { name: "grey" }
        ListElement { name: "green" }
        ListElement { name: "greenyellow" }
        ListElement { name: "honeydew" }
        ListElement { name: "hotpink" }
        ListElement { name: "indianred" }
        ListElement { name: "indigo" }
        ListElement { name: "ivory" }
        ListElement { name: "khaki" }
        ListElement { name: "lavender" }
        ListElement { name: "lavenderblush" }
        ListElement { name: "lawngreen" }
        ListElement { name: "lemonchiffon" }
        ListElement { name: "lightblue" }
        ListElement { name: "lightcoral" }
        ListElement { name: "lightcyan" }
        ListElement { name: "lightgoldenrodyellow" }
        ListElement { name: "lightgray" }
        ListElement { name: "lightgreen" }
        ListElement { name: "lightgrey" }
        ListElement { name: "lightpink" }
        ListElement { name: "lightsalmon" }
        ListElement { name: "lightseagreen" }
        ListElement { name: "lightskyblue" }
        ListElement { name: "lightslategray" }
        ListElement { name: "lightslategrey" }
        ListElement { name: "lightsteelblue" }
        ListElement { name: "lightyellow" }
        ListElement { name: "lime" }
        ListElement { name: "limegreen" }
        ListElement { name: "linen" }
        ListElement { name: "magenta" }
        ListElement { name: "maroon" }
        ListElement { name: "mediumaquamarine" }
        ListElement { name: "mediumblue" }
        ListElement { name: "mediumorchid" }
        ListElement { name: "mediumpurple" }
        ListElement { name: "mediumseagreen" }
        ListElement { name: "mediumslateblue" }
        ListElement { name: "mediumspringgreen" }
        ListElement { name: "mediumturquoise" }
        ListElement { name: "mediumvioletred" }
        ListElement { name: "midnightblue" }
        ListElement { name: "mintcream" }
        ListElement { name: "mistyrose" }
        ListElement { name: "moccasin" }
        ListElement { name: "navajowhite" }
        ListElement { name: "navy" }
        ListElement { name: "oldlace" }
        ListElement { name: "olive" }
        ListElement { name: "olivedrab" }
        ListElement { name: "orange" }
        ListElement { name: "orangered" }
        ListElement { name: "orchid" }
        ListElement { name: "palegoldenrod" }
        ListElement { name: "palegreen" }
        ListElement { name: "paleturquoise" }
        ListElement { name: "palevioletred" }
        ListElement { name: "papayawhip" }
        ListElement { name: "peachpuff" }
        ListElement { name: "peru" }
        ListElement { name: "pink" }
        ListElement { name: "plum" }
        ListElement { name: "powderblue" }
        ListElement { name: "purple" }
        ListElement { name: "red" }
        ListElement { name: "rosybrown" }
        ListElement { name: "royalblue" }
        ListElement { name: "saddlebrown" }
        ListElement { name: "salmon" }
        ListElement { name: "sandybrown" }
        ListElement { name: "seagreen" }
        ListElement { name: "seashell" }
        ListElement { name: "sienna" }
        ListElement { name: "silver" }
        ListElement { name: "skyblue" }
        ListElement { name: "slateblue" }
        ListElement { name: "slategray" }
        ListElement { name: "slategrey" }
        ListElement { name: "snow" }
        ListElement { name: "springgreen" }
        ListElement { name: "steelblue" }
        ListElement { name: "tan" }
        ListElement { name: "teal" }
        ListElement { name: "thistle" }
        ListElement { name: "tomato" }
        ListElement { name: "turquoise" }
        ListElement { name: "violet" }
        ListElement { name: "wheat" }
        ListElement { name: "white" }
        ListElement { name: "whitesmoke" }
        ListElement { name: "yellow" }
        ListElement { name: "yellowgreen" }
    }
}
